import Taro, { Component } from '@tarojs/taro'
import { View, Button, Text,OpenData,Image} from '@tarojs/components'
import { AtList, AtListItem,AtButton} from "taro-ui"
import LogoPng from "./../../assets/image/logo.png";
import './index.scss'
class Index extends Component {
  config = {
    navigationBarTitleText: '设置'
  }

  componentWillReceiveProps (nextProps) {
    console.log(this.props, nextProps)
  }
  
  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }
  navigator = (url)=>{
    Taro.navigateTo({
      url:url
    })
  }
  concat = ()=>{
    Taro.makePhoneCall({
      phoneNumber: '13958243595' 
    })
  }
  render () {
    return (
      <View className='settingPage'>
        <View className='top'>
            <View className='left'>
              <OpenData type='userAvatarUrl'  />
            </View>
            <View className='right'>
              <OpenData type='userNickName'  />
            </View>
        </View>
        <View className="content">
            <AtList>
              <AtListItem onClick={this.navigator.bind(this,"./../order/index")} title='我的订单' arrow='right' />
              <AtListItem onClick={this.navigator.bind(this,"./../address/index")} title='收货地址' arrow='right' />
              <AtListItem onClick={this.concat} title='客服电话' arrow='right' />
            </AtList>
        </View>
        <View style={{marginTop:"20px"}}>
          <AtButton type='secondary' className="concat" openType='contact'>联系客服微信</AtButton>
        </View>
        <View className="bottom">
          <Image mode="widthFix" src={LogoPng} />
        <View>黑莓严选</View>
        </View>
      </View>
    )
  }
}

export default Index
